package com.ssd.controller.inner;

import com.ssd.api.user.AddressApi;
import com.ssd.api.user.dto.AddressBook;
import com.ssd.service.IAddressBookService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 内容接口-地址薄
 */
@RestController
@RequestMapping("/inner/address")
public class AddressApiController implements AddressApi {
    @Resource
    private IAddressBookService addressBookService;
    /**
     * 查询当前登录用户的默认地址
     * @return
     */
    @Override
    @GetMapping("/default")
    public AddressBook getAddress(@RequestParam("address") Long address) {
        return addressBookService.getById(address);
    }
}
